/**
* @author Ashish Gupta
* CVSSP, University of Surrey
* Copyright (c) 2010 Ashish Gupta
* All rights reserved.
*/
/**
 * 
 */
package hash;

import image.ImageList;

import java.util.ArrayList;

/**
 * @author Ashish
 *
 */
public class Cell {
	private Integer classType;
	private Integer cellIdx;
	private ArrayList<FeatureVectorIdentity> featureVectorIdentities;
	/**
	 * @param imageList 
	 * @param classType the classType to calc
	 */
	public void calcClassType(ImageList imageList) {
		int classType = 0;
		for(int i=0;i<featureVectorIdentities.size();i++){
			String imageName = featureVectorIdentities.get(i).getImageName();
			int imgIdx = imageList.getImageNames().indexOf(imageName);
			Double classLabel = imageList.getClassLabels().get(imgIdx);
			classType += classLabel;
		}
		if(classType >= 0){
			this.classType = 1;
		}
		else{
			this.classType = -1;
		}
	}
	/**
	 * @return the classType
	 */
	public Integer getClassType() {
		return classType;
	}
	/**
	 * @param cellIdx the cellIdx to set
	 */
	public void setCellIdx(Integer cellIdx) {
		this.cellIdx = cellIdx;
	}
	/**
	 * @return the cellIdx
	 */
	public Integer getCellIdx() {
		return cellIdx;
	}
	/**
	 * @param featureVectorIdentity the featureVectorIdentity to set
	 */
	public void setFeatureVectorIdentity(ArrayList<FeatureVectorIdentity> featureVectorIdentities) {
		this.featureVectorIdentities = featureVectorIdentities;
	}
	
	/**
	 * @param featureVectorIdentity
	 */
	public void addFeatureVectorIdentity(FeatureVectorIdentity featureVectorIdentity){
		this.featureVectorIdentities.add(featureVectorIdentity);
	}
	/**
	 * @return the featureVectorIdentity
	 */
	public ArrayList<FeatureVectorIdentity> getFeatureVectorIdentities() {
		return featureVectorIdentities;
	}
	
}
